#ifndef _MESH_H
#define _MESH_H

#include <GL/gl.h>
#include <stdlib.h>
#include <stdio.h>

typedef struct
{
    float x, y, z;        //Vertex
    float nx, ny, nz;     //Normal
    float u0, v0;         //Texcoord0
    float u1, v1;         //Texcoord1
    float u2, v2;         //Texcoord2
    float padding[4];
} Vertex;

typedef struct
{
    int vertex_qty;
    int poly_mode;
    Vertex *vertex;
} Mesh;

int mesh_malloc(Mesh *pMesh, int pVertexQty);
int mesh_free(Mesh *pMesh);
int mesh_make_cube(Mesh *pMesh, int pSize);
int draw_mesh(Mesh *pMesh);

#endif
